<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算器</title>
    <input type="text">
    <select name="" id="">
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
    </select>
    <input type="text">
    <button>=</button>
    <input type="text" disabled>
</head>

<body>
    <script>
        (function () {
            let select = document.querySelector('select');
            let inps = document.querySelectorAll('input');
            let btn = document.querySelector('button');

            btn.addEventListener('click', () => {
                if (select.value == '+') inps[2].value = inps[0].value * 1 + inps[1].value * 1;
                if (select.value == '-') inps[2].value = inps[0].value - inps[1].value;
                if (select.value == '*') inps[2].value = inps[0].value * inps[1].value;
                if (select.value == '/') inps[2].value = inps[0].value / inps[1].value;
            })
        })();
    </script>
</body>

</html>